<?php if ( ! defined('ABSPATH')) exit('restricted access'); ?>
<?php global $_webnukes;?>
<?php $contact_information = $_webnukes->get_settings('contact_information'); /** get contact details from options */ ?>
<div class="container">
	<div class="grids no-padding-top no-bakcground">
		<div class="col-2">
			<div class="block">
				<div class="heading">
					<?php _e('Send us your Message', THEME_NAME); ?>
				</div>
				
				<form action="" method="post">
					<?php
					if(count($_POST))
					{
						do_action('nuke_submit_contact_form', $_POST); 
						echo $_POST['submission_message'];
					}?>
					
					<h3><?php _e('Your Name', THEME_NAME);?>*</h3>
					<input type="text" name="contact_name" class="text_short name" value="<?php _e('Enter Name', THEME_NAME);?>" onfocus="if(this.value == '<?php _e('Enter Name', THEME_NAME);?>') { this.value = ''; }" onblur="if(this.value == '') { this.value = '<?php _e('Enter Name', THEME_NAME);?>'; }" />

					<h3><?php _e('Email Address', THEME_NAME);?>*</h3>
					<input type="text" name="contact_email" class="text_short email" value="<?php _e('Enter Email', THEME_NAME);?>" onfocus="if(this.value == '<?php _e('Enter Email', THEME_NAME);?>') { this.value = ''; }" onblur="if(this.value == '') { this.value = '<?php _e('Enter Email', THEME_NAME);?>'; }" />

					<h3><?php _e('Website URL', THEME_NAME);?>*</h3>
					<input type="text" name="contact_website" class="text website" value="<?php _e('Enter Website', THEME_NAME);?>" onfocus="if(this.value == '<?php _e('Enter Website', THEME_NAME);?>') { this.value = ''; }" onblur="if(this.value == '') { this.value = '<?php _e('Enter Website', THEME_NAME);?>'; }" />

					<h3><?php _e('Description', THEME_NAME);?>*</h3>
					<textarea class="textarea" name="contact_message" rows="" cols="5"></textarea>
                    
                    <?php
					//ADD RECAPTCHA AT THE END OF FORM
					if($this->_webnukes->kvalue($contact_information, 'captcha') == 'active' && $contact_information['key'])
					{
						require_once('recaptchalib.php');
						echo recaptcha_get_html($contact_information['key']);
					} 
					?>
                    
					<input type="submit" class="button" value="<?php _e('Submit', THEME_NAME);?>" />
				</form>
			</div>

			<div class="block">
				<div class="heading">
					<?php _e('Contact Us at', THEME_NAME);?>
					<span class="blue"><?php bloginfo('name');?></span>
				</div>
				
				<?php
				$contact = $this->_webnukes->get_settings('contact_information');
				if($this->_webnukes->kvalue($contact,'status') == 'active' && $this->_webnukes->kvalue($contact, 'DYNAMIC')): 
					$tabs_title = array_map(create_function('$v', 'return $v["title"];'), $this->_webnukes->kvalue($contact, 'DYNAMIC'));?>
				
					<div class="tabs">
						<ul class="tabber">
							<?php foreach($tabs_title as $k => $v ): 
							$selected = ($k == 1) ? 'selected' : '';?>
							<li class="tab<?php echo $k; ?> <?php echo $selected; ?> mouseout"><a href="javascript:void(0);"> <?php echo $v; ?></a><span class="poparr"></span></li>
							<?php endforeach; ?>
						</ul>
						<div class="tabBody">
						<?php foreach($this->_webnukes->kvalue($contact, 'DYNAMIC') as $key => $val): ?>
							<?php $display = ($key == 1 ) ? 'block' : 'none'; ?>
							<div class="parent" id="tab<?php echo $key; ?>" style="display: <?php echo $display; ?>;">
							<div class="tab-contents" style="display: block;">
							
								<!-- Google Map -->
								<?php if($this->_webnukes->kvalue($val, 'show_map') == 'active'):?>
								<div class="google_map">
									<?php echo $this->_webnukes->kvalue($val, 'google_map');?>
								</div>
								<?php endif;?>
								
								<?php /** Whether address 2 is activ to show or not */
                                $block_class = ($this->_webnukes->kvalue($val, 'address2_status') == 'active') ? 'class="block"' : '';?>
								
								<div <?php echo $block_class;?>>
									<div class="heading">
										<span class="blue"><?php echo $this->_webnukes->kvalue($val, 'address1_title'); ?></span>
									</div>
									
									<p> <?php echo nl2br($this->_webnukes->kvalue($val, 'address1')); ?></p>
									
									<div>
										<span class="blue">
										<?php _e('Ph:', THEME_NAME); ?>
										</span> <?php echo $this->_webnukes->kvalue($val, 'phone1');?>
									</div>

									<div>
										<span class="blue">
										<?php _e('Fax:', THEME_NAME); ?>
										</span> <?php echo $this->_webnukes->kvalue($val, 'fax1');?>
									</div>
								</div>
								
								<?php if($this->_webnukes->kvalue($val, 'address2_status') == 'active'): /** If Address 2 is active to show */?>
								<div <?php echo $block_class; ?>>
									<div class="heading"><span class="blue"><?php echo $this->_webnukes->kvalue($val, 'address2_title'); ?></span></div>
									<p> <?php echo nl2br($this->_webnukes->kvalue($val, 'address2')); ?></p>
									<div>
										<span class="blue">
										<?php _e('Ph:', THEME_NAME); ?>
										</span>
										<?php echo $this->_webnukes->kvalue($val, 'phone2'); ?>
									</div>
									<div>
										<span class="blue">
										<?php _e('Fax:', THEME_NAME); ?>
										</span> <?php echo $this->_webnukes->kvalue($val, 'fax2'); ?>
									</div>
								</div>
								<?php endif; ?>
							</div>
						</div>
						<?php endforeach; ?>
					</div>
				</div>
				<?php endif; ?>
			</div>
		</div>
	</div>
</div>